<?php
include('../../../php/eliminar_cache.php');
include_once('../../../php/bd.php');
@require_once('../../../php/funciones.php');
@require_once('codigo/procesar.php');
  
  $id_acc = $_GET['id'];
  $bd = new DB();
  @$select_acciones = $bd->query("SELECT * FROM accion INNER JOIN registro_accion ON accion.id_acc=registro_accion.id_acc INNER JOIN detalle_categorias ON accion.id_acc=detalle_categorias.id_acc INNER JOIN nivel ON accion.id_nivel=nivel.id_nivel WHERE accion.id_acc='$id_acc' ", OBJ);
  @$select_categorias = $bd->query("SELECT * FROM detalle_categorias INNER JOIN categoria_gastos ON detalle_categorias.id_cat_gas=categoria_gastos.id_cat_gas WHERE detalle_categorias.id_acc='$id_acc'",OBJ);
  @$select_sub_categorias = $bd->query("SELECT * FROM detalle_sub_categorias INNER JOIN sub_categoria_gastos ON detalle_sub_categorias.id_sub_cat_gas=sub_categoria_gastos.id_sub_cat_gas WHERE detalle_sub_categorias.id_acc='$id_acc'",OBJ);

  @$select_11 = $bd->query("SELECT * FROM detalle_seccion_11 INNER JOIN sub_sectores ON detalle_seccion_11.subsector_sec_11=sub_sectores.id_sub INNER JOIN ambitos ON detalle_seccion_11.ambito_sec_11=ambitos.id_amb WHERE detalle_seccion_11.id_acc='$id_acc'",OBJ);
  @$select_12 = $bd->query("SELECT * FROM detalle_seccion_12 INNER JOIN areas ON detalle_seccion_12.area_sec_12=areas.id_area WHERE detalle_seccion_12.id_acc='$id_acc'",OBJ);

  echo '<input name="actualizar" type="hidden" value="1" />';
  echo '<fieldset>';
  echo '<table  border="0" style="width:700px;">';

  echo '<tr>';
  echo '<td>Seccion:</td>';
  echo '<td>'.select("seccion_acc","id_sec","nombre_sec","seccion",$select_acciones->rows[0]->id_sec).'</td>';
  echo '</tr>';

  echo '</table>';
  echo '</fieldset>';

  if($select_acciones->rows[0]->id_sec == 5){ @include("seccion_5_editar.php"); }
  if($select_acciones->rows[0]->id_sec == 11){ @include("seccion_11_editar.php"); }
  if($select_acciones->rows[0]->id_sec == 12){ @include("seccion_12_editar.php"); }
?>